Demonstration of SMPS Calculations

The SMPS calculations require two main packages from atmPy - smps and dma. dma contains the DMA class and its children. The children of DMA simply contain the definition of the dimensions of the DMA used in the current SMPS instance. In this case, we use the definition of the NOAA wide DMA, which has the dimensions $r_i = 0.0312$, $r_o = 0.03613$ and $l = 0.34054$ where all units are in meters. The SMPS object provides a set of utilities for taking the scan data, applying a transfer function and correcting the distribution for multiple charges to produce a size distribution.

The import of the sizedistribution package allows us to manipulate the output of the DMA ($dN/d\log{D_p}$) such that we can pull out other representations of the size distribution. The remaining packages are simply used for data manipulation.


In [34]:
from atmPy.instruments.DMA import smps
from atmPy.instruments.DMA import dma
from matplotlib import colors
import matplotlib.pyplot as plt
from numpy import meshgrid
import numpy as np
import pandas as pd
from matplotlib.dates import date2num
from matplotlib import dates
from atmPy import sizedistribution as sd
%matplotlib inline

The first thing we do in the analysis is we create a new SMPS object with the DMA instance we wish to use. Here, we also set the initial directory to search for SMPS data. When a new SMPS object is created, an open file dialog window will be produced and the user may select one or many files to analyze. The file names will be stored in the SMPS attribute files.


In [35]:
hagis = smps.SMPS(dma.NoaaWide(),scan_folder="C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans")

Determining the Lag

In order to properly analyze a scan, we must first align the data such that the particle concentrations are consistent with the conditions in the DMA. Although conditions such as voltages and flows adjust to changes almost immediately, there will be a lag in the particle response due to isntrument residence time. We can determine the lag either through a correlation or heuristically. The SMPS provides a function getLag which takes an integer indicating the file index to select in the attribute files containing the array of files selected by the user. The optional input, delta, allows the user to offset the result of the correlation by some amount to provide a more reasonable estimate of the lag.

The SMPS::getLag method will produce two plots. The first is the results from the attempted correlation and the second shows how the two scans align with the lag estimate, both the smoothed and raw data. This method will set the lag attribute in the SMPS instance which will be used in future calculations. This attribute is directly accessible if the user wishes to adjust it.


In [36]:
hagis.getLag(10, delta=10)


Processing the Files

Once the user has pointed to the files they wish to use, they can begin processing of the files using the function SMPS::procFiles(). Each file is processed as follows:

  1. The raw data concerning the conditions is truncated for both the up and down scans to the beginning and end of the respective scans. The important parameters here are the values $t_{scan}$ and $t_{dwell}$ from the header of the files. The range of the data from the upscan spans the indices 0 to $t_{scan}$ and the range for the down data is $t_{scan}+t_{dwell}$ to $2\times t_{scan}+t_{dwell}$.
  2. The CN data is adjusted based on the lag. This data is truncated for the up scan as $t_{lag}$ to $t_{lag} + t_{scan}$ where $t_{lag}$ is the lag time determined by the user (possibly with the function SMPS::getLag(). In the downward scan, the data array is reversed and the data is truncated to the range $t_{dwell}-t_{lag}$ to $t_{scan}+t_{dwell}-t_{lag}$. In all cases, the CN concentration is calculated from the 1 second buffer and the CPC flow rate as $N_{1 s}/Q_{cpc}$.
  3. The truncated [CN] is then smoothed using a Lowess smoothing function for both the up and down data.
  4. Diameters for each of the corresponding [CN] are then calculated from the set point voltage (rather than the measured voltage).
  5. The resulting diameters and smoothed [CN] are then run through a transfer function. In this case, the transfer function is a simple full width half max based off of the mobility range of the current voltage. This function allows us to produce a $d\log D_p$ for the ditribution.
  6. The distribution is then corrected based on the algorithm described below.
  7. The charge corrected distribution is then converted to a logarithmic distribution using the values from the FWHM function.
  8. The resulting distribution is then interpolated onto a logarithmically distributed array that consists of bin ranging from 1 to 1000 nm.

In [37]:
hagis.lag = 10
hagis.proc_files()


C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_08_20_41.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_08_31_11.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_08_41_41.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_08_52_11.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_09_02_41.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_09_13_12.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_09_23_42.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_09_34_12.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_09_44_42.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_09_55_12.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_10_05_43.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_10_16_13.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_10_26_43.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_10_37_13.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_10_47_43.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_10_58_14.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_11_08_44.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_11_19_14.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_11_29_44.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_11_40_14.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_11_50_45.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_12_01_15.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_12_11_45.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_12_22_15.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_12_32_45.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_12_43_16.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_12_53_46.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_13_04_16.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_13_14_46.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_13_25_16.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_13_35_47.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_13_46_17.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_13_56_47.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_14_07_17.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_14_17_47.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_14_28_18.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_14_38_48.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_14_49_18.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_14_59_48.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_15_10_18.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_15_20_49.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_15_31_19.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_15_41_49.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_15_52_19.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_16_02_49.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_16_13_20.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_16_23_50.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_16_34_20.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_16_44_50.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_16_55_20.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_17_05_51.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_17_16_21.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_17_26_51.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_17_37_21.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_17_47_51.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_17_58_22.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_18_08_52.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_18_19_22.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_18_29_52.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_18_40_22.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_18_50_53.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_19_01_23.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_19_11_53.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_19_22_23.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_19_32_53.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_19_43_24.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_19_53_54.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_20_04_24.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_20_14_54.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_20_25_24.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_20_35_55.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_20_46_25.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_20_56_55.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_21_07_25.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_21_17_55.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_21_28_26.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_21_38_56.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_21_49_26.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_21_59_56.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_22_10_26.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_22_20_57.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_22_31_27.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_22_41_57.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_22_52_27.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_23_02_57.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_23_13_28.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_23_23_58.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_23_34_28.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_23_44_58.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150315_23_55_28.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_00_05_59.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_00_16_29.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_00_26_59.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_00_37_29.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_00_47_59.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_00_58_30.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_01_09_00.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_01_19_30.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_01_30_00.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_01_40_30.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_01_51_01.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_02_01_31.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_02_12_01.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_02_22_31.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_02_33_01.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_02_43_32.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_02_54_02.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_03_04_32.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_03_15_02.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_03_25_32.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_03_36_03.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_03_46_33.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_03_57_03.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_04_07_33.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_04_18_03.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_04_28_34.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_04_39_04.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_04_49_34.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_05_00_04.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_05_10_34.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_05_21_05.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_05_31_35.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_05_42_05.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_05_52_35.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_06_03_05.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_06_13_36.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_06_24_06.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_06_34_36.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_06_45_06.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_06_55_36.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_07_06_07.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_07_16_37.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_07_27_07.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_07_37_37.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_07_48_07.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_07_58_38.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_08_09_08.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_08_19_38.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_08_30_08.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_08_40_38.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_08_51_09.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_09_01_39.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_09_12_09.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_09_22_39.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_09_33_09.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_09_43_40.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_09_54_10.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_10_04_40.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_10_15_10.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_10_25_40.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_10_36_11.txt
Issue processing file C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_10_36_11.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_10_42_24.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_10_46_44.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_10_51_04.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_10_55_24.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_10_59_44.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_11_04_04.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_11_08_25.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_11_12_45.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_11_17_05.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_11_21_25.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_11_25_45.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_11_30_06.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_11_34_26.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_11_38_46.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_11_43_06.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_11_47_26.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_11_51_47.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_11_56_07.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_00_27.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_04_47.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_09_07.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_13_28.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_17_48.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_22_08.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_26_28.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_30_48.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_35_09.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_39_29.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_43_49.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_48_09.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_52_29.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_12_56_50.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_01_10.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_05_30.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_09_50.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_14_10.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_18_31.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_22_51.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_27_11.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_31_31.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_35_51.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_40_12.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_44_32.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_48_52.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_53_12.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_13_57_32.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_01_53.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_06_13.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_10_33.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_14_53.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_19_13.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_23_34.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_27_54.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_32_14.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_36_34.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_40_54.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_45_15.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_49_35.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_53_55.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_14_58_15.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_02_35.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_06_56.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_11_16.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_15_36.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_19_56.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_24_16.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_28_37.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_32_57.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_37_17.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_41_37.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_45_57.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_50_18.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_54_38.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_15_58_58.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_03_18.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_07_38.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_11_59.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_16_19.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_20_39.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_24_59.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_29_19.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_33_40.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_38_00.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_42_20.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_46_40.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_51_00.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_55_21.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_16_59_41.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_17_04_01.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_17_08_21.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_17_12_41.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_17_17_02.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_17_21_22.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_17_25_42.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_17_30_02.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_17_34_22.txt
C:/Users/mrichardson/Documents/HAGIS/SMPS/Scans/SCAN_20150316_17_38_43.txt

Charge Correction

The SMPS scans mobilities which are a function of voltage. In truth, at each voltage setpoint, the DMA allows a range of particle mobilities through the instrument. This range is expressed by the DMA transfer function as

\begin{equation} \Omega = 1/q_a\max{\left[q_a,q_s,\left[\frac{1}{2}\left(q_a+q_s\right)-\right]\right]} \end{equation}\begin{equation} Z=\frac{n*e*Cc(D_p)}{3*\pi*\mu(T)*D_p} \end{equation}

In any charge correction, we must assume that there are no particles beyond the topmost bin. This allows us to make the assumption that all particles in that bin are singly charged. In order to determine the total number of particles in the current bin, we can simply use Wiedensohler's equation for the charging efficiency for singly charged particles. Starting at the topmost bin, we can calculate the total number of particles as

\begin{equation} \frac{N_1(D_p,i)}{f_1}=N(D_p) \end{equation}

where $N_1$ is the number of particles of size $D_p$ having 1 charge, $f_1$ is the charging efficiency for singly charged particles and $N(D_p)$ is the total number of particles diameter $D_p$. Using the initial number of particles, we can then calculated the number of multiply charged particles in a similar fashion.

Once these numbers have been calculated, we can determine the location of the multiply charged particles (i.e. the diameter bin with which they have been identified). To do

Finally, to get the total number of particles in the bin, we can apply the sum

\begin{equation} N(D_p) = \frac{N_1(D_p)}{f_1}\sum_{i=0}^\inf{f_i} \end{equation}

However, in each of these cases, only a finite number of particles may be available in each bin, so in the code, we will have to take the minimum of the following:

\begin{equation} \delta{N(k)}=\min{\left(\frac{f_iN_1}{f_1},N_k\right)} \end{equation}

where $\delta{N(k)}$ is the number of particles to remove from bin $k$ and $N_k$ is the number of particles in bin $k$.

Output

In the following, we take the results from the SMPS::procFiles() method and produce a color map of size distributions in $dN/d\log D_p$ space as a function of time. The attribute date from the instance of SMPS is a set of DateTime for each scan based on the start time of the file and the scan time collected from the header.


In [38]:
hagis.date


Out[38]:
[datetime.datetime(2015, 3, 15, 8, 20, 41),
 datetime.datetime(2015, 3, 15, 8, 25, 56),
 datetime.datetime(2015, 3, 15, 8, 31, 11),
 datetime.datetime(2015, 3, 15, 8, 36, 26),
 datetime.datetime(2015, 3, 15, 8, 41, 41),
 datetime.datetime(2015, 3, 15, 8, 46, 56),
 datetime.datetime(2015, 3, 15, 8, 52, 11),
 datetime.datetime(2015, 3, 15, 8, 57, 26),
 datetime.datetime(2015, 3, 15, 9, 2, 41),
 datetime.datetime(2015, 3, 15, 9, 7, 56),
 datetime.datetime(2015, 3, 15, 9, 13, 12),
 datetime.datetime(2015, 3, 15, 9, 18, 27),
 datetime.datetime(2015, 3, 15, 9, 23, 42),
 datetime.datetime(2015, 3, 15, 9, 28, 57),
 datetime.datetime(2015, 3, 15, 9, 34, 12),
 datetime.datetime(2015, 3, 15, 9, 39, 27),
 datetime.datetime(2015, 3, 15, 9, 44, 42),
 datetime.datetime(2015, 3, 15, 9, 49, 57),
 datetime.datetime(2015, 3, 15, 9, 55, 12),
 datetime.datetime(2015, 3, 15, 10, 0, 27),
 datetime.datetime(2015, 3, 15, 10, 5, 43),
 datetime.datetime(2015, 3, 15, 10, 10, 58),
 datetime.datetime(2015, 3, 15, 10, 16, 13),
 datetime.datetime(2015, 3, 15, 10, 21, 28),
 datetime.datetime(2015, 3, 15, 10, 26, 43),
 datetime.datetime(2015, 3, 15, 10, 31, 58),
 datetime.datetime(2015, 3, 15, 10, 37, 13),
 datetime.datetime(2015, 3, 15, 10, 42, 28),
 datetime.datetime(2015, 3, 15, 10, 47, 43),
 datetime.datetime(2015, 3, 15, 10, 52, 58),
 datetime.datetime(2015, 3, 15, 10, 58, 14),
 datetime.datetime(2015, 3, 15, 11, 3, 29),
 datetime.datetime(2015, 3, 15, 11, 8, 44),
 datetime.datetime(2015, 3, 15, 11, 13, 59),
 datetime.datetime(2015, 3, 15, 11, 19, 14),
 datetime.datetime(2015, 3, 15, 11, 24, 29),
 datetime.datetime(2015, 3, 15, 11, 29, 44),
 datetime.datetime(2015, 3, 15, 11, 34, 59),
 datetime.datetime(2015, 3, 15, 11, 40, 14),
 datetime.datetime(2015, 3, 15, 11, 45, 29),
 datetime.datetime(2015, 3, 15, 11, 50, 45),
 datetime.datetime(2015, 3, 15, 11, 56),
 datetime.datetime(2015, 3, 15, 12, 1, 15),
 datetime.datetime(2015, 3, 15, 12, 6, 30),
 datetime.datetime(2015, 3, 15, 12, 11, 45),
 datetime.datetime(2015, 3, 15, 12, 17),
 datetime.datetime(2015, 3, 15, 12, 22, 15),
 datetime.datetime(2015, 3, 15, 12, 27, 30),
 datetime.datetime(2015, 3, 15, 12, 32, 45),
 datetime.datetime(2015, 3, 15, 12, 38),
 datetime.datetime(2015, 3, 15, 12, 43, 16),
 datetime.datetime(2015, 3, 15, 12, 48, 31),
 datetime.datetime(2015, 3, 15, 12, 53, 46),
 datetime.datetime(2015, 3, 15, 12, 59, 1),
 datetime.datetime(2015, 3, 15, 13, 4, 16),
 datetime.datetime(2015, 3, 15, 13, 9, 31),
 datetime.datetime(2015, 3, 15, 13, 14, 46),
 datetime.datetime(2015, 3, 15, 13, 20, 1),
 datetime.datetime(2015, 3, 15, 13, 25, 16),
 datetime.datetime(2015, 3, 15, 13, 30, 31),
 datetime.datetime(2015, 3, 15, 13, 35, 47),
 datetime.datetime(2015, 3, 15, 13, 41, 2),
 datetime.datetime(2015, 3, 15, 13, 46, 17),
 datetime.datetime(2015, 3, 15, 13, 51, 32),
 datetime.datetime(2015, 3, 15, 13, 56, 47),
 datetime.datetime(2015, 3, 15, 14, 2, 2),
 datetime.datetime(2015, 3, 15, 14, 7, 17),
 datetime.datetime(2015, 3, 15, 14, 12, 32),
 datetime.datetime(2015, 3, 15, 14, 17, 47),
 datetime.datetime(2015, 3, 15, 14, 23, 2),
 datetime.datetime(2015, 3, 15, 14, 28, 18),
 datetime.datetime(2015, 3, 15, 14, 33, 33),
 datetime.datetime(2015, 3, 15, 14, 38, 48),
 datetime.datetime(2015, 3, 15, 14, 44, 3),
 datetime.datetime(2015, 3, 15, 14, 49, 18),
 datetime.datetime(2015, 3, 15, 14, 54, 33),
 datetime.datetime(2015, 3, 15, 14, 59, 48),
 datetime.datetime(2015, 3, 15, 15, 5, 3),
 datetime.datetime(2015, 3, 15, 15, 10, 18),
 datetime.datetime(2015, 3, 15, 15, 15, 33),
 datetime.datetime(2015, 3, 15, 15, 20, 49),
 datetime.datetime(2015, 3, 15, 15, 26, 4),
 datetime.datetime(2015, 3, 15, 15, 31, 19),
 datetime.datetime(2015, 3, 15, 15, 36, 34),
 datetime.datetime(2015, 3, 15, 15, 41, 49),
 datetime.datetime(2015, 3, 15, 15, 47, 4),
 datetime.datetime(2015, 3, 15, 15, 52, 19),
 datetime.datetime(2015, 3, 15, 15, 57, 34),
 datetime.datetime(2015, 3, 15, 16, 2, 49),
 datetime.datetime(2015, 3, 15, 16, 8, 4),
 datetime.datetime(2015, 3, 15, 16, 13, 20),
 datetime.datetime(2015, 3, 15, 16, 18, 35),
 datetime.datetime(2015, 3, 15, 16, 23, 50),
 datetime.datetime(2015, 3, 15, 16, 29, 5),
 datetime.datetime(2015, 3, 15, 16, 34, 20),
 datetime.datetime(2015, 3, 15, 16, 39, 35),
 datetime.datetime(2015, 3, 15, 16, 44, 50),
 datetime.datetime(2015, 3, 15, 16, 50, 5),
 datetime.datetime(2015, 3, 15, 16, 55, 20),
 datetime.datetime(2015, 3, 15, 17, 0, 35),
 datetime.datetime(2015, 3, 15, 17, 5, 51),
 datetime.datetime(2015, 3, 15, 17, 11, 6),
 datetime.datetime(2015, 3, 15, 17, 16, 21),
 datetime.datetime(2015, 3, 15, 17, 21, 36),
 datetime.datetime(2015, 3, 15, 17, 26, 51),
 datetime.datetime(2015, 3, 15, 17, 32, 6),
 datetime.datetime(2015, 3, 15, 17, 37, 21),
 datetime.datetime(2015, 3, 15, 17, 42, 36),
 datetime.datetime(2015, 3, 15, 17, 47, 51),
 datetime.datetime(2015, 3, 15, 17, 53, 6),
 datetime.datetime(2015, 3, 15, 17, 58, 22),
 datetime.datetime(2015, 3, 15, 18, 3, 37),
 datetime.datetime(2015, 3, 15, 18, 8, 52),
 datetime.datetime(2015, 3, 15, 18, 14, 7),
 datetime.datetime(2015, 3, 15, 18, 19, 22),
 datetime.datetime(2015, 3, 15, 18, 24, 37),
 datetime.datetime(2015, 3, 15, 18, 29, 52),
 datetime.datetime(2015, 3, 15, 18, 35, 7),
 datetime.datetime(2015, 3, 15, 18, 40, 22),
 datetime.datetime(2015, 3, 15, 18, 45, 37),
 datetime.datetime(2015, 3, 15, 18, 50, 53),
 datetime.datetime(2015, 3, 15, 18, 56, 8),
 datetime.datetime(2015, 3, 15, 19, 1, 23),
 datetime.datetime(2015, 3, 15, 19, 6, 38),
 datetime.datetime(2015, 3, 15, 19, 11, 53),
 datetime.datetime(2015, 3, 15, 19, 17, 8),
 datetime.datetime(2015, 3, 15, 19, 22, 23),
 datetime.datetime(2015, 3, 15, 19, 27, 38),
 datetime.datetime(2015, 3, 15, 19, 32, 53),
 datetime.datetime(2015, 3, 15, 19, 38, 8),
 datetime.datetime(2015, 3, 15, 19, 43, 24),
 datetime.datetime(2015, 3, 15, 19, 48, 39),
 datetime.datetime(2015, 3, 15, 19, 53, 54),
 datetime.datetime(2015, 3, 15, 19, 59, 9),
 datetime.datetime(2015, 3, 15, 20, 4, 24),
 datetime.datetime(2015, 3, 15, 20, 9, 39),
 datetime.datetime(2015, 3, 15, 20, 14, 54),
 datetime.datetime(2015, 3, 15, 20, 20, 9),
 datetime.datetime(2015, 3, 15, 20, 25, 24),
 datetime.datetime(2015, 3, 15, 20, 30, 39),
 datetime.datetime(2015, 3, 15, 20, 35, 55),
 datetime.datetime(2015, 3, 15, 20, 41, 10),
 datetime.datetime(2015, 3, 15, 20, 46, 25),
 datetime.datetime(2015, 3, 15, 20, 51, 40),
 datetime.datetime(2015, 3, 15, 20, 56, 55),
 datetime.datetime(2015, 3, 15, 21, 2, 10),
 datetime.datetime(2015, 3, 15, 21, 7, 25),
 datetime.datetime(2015, 3, 15, 21, 12, 40),
 datetime.datetime(2015, 3, 15, 21, 17, 55),
 datetime.datetime(2015, 3, 15, 21, 23, 10),
 datetime.datetime(2015, 3, 15, 21, 28, 26),
 datetime.datetime(2015, 3, 15, 21, 33, 41),
 datetime.datetime(2015, 3, 15, 21, 38, 56),
 datetime.datetime(2015, 3, 15, 21, 44, 11),
 datetime.datetime(2015, 3, 15, 21, 49, 26),
 datetime.datetime(2015, 3, 15, 21, 54, 41),
 datetime.datetime(2015, 3, 15, 21, 59, 56),
 datetime.datetime(2015, 3, 15, 22, 5, 11),
 datetime.datetime(2015, 3, 15, 22, 10, 26),
 datetime.datetime(2015, 3, 15, 22, 15, 41),
 datetime.datetime(2015, 3, 15, 22, 20, 57),
 datetime.datetime(2015, 3, 15, 22, 26, 12),
 datetime.datetime(2015, 3, 15, 22, 31, 27),
 datetime.datetime(2015, 3, 15, 22, 36, 42),
 datetime.datetime(2015, 3, 15, 22, 41, 57),
 datetime.datetime(2015, 3, 15, 22, 47, 12),
 datetime.datetime(2015, 3, 15, 22, 52, 27),
 datetime.datetime(2015, 3, 15, 22, 57, 42),
 datetime.datetime(2015, 3, 15, 23, 2, 57),
 datetime.datetime(2015, 3, 15, 23, 8, 12),
 datetime.datetime(2015, 3, 15, 23, 13, 28),
 datetime.datetime(2015, 3, 15, 23, 18, 43),
 datetime.datetime(2015, 3, 15, 23, 23, 58),
 datetime.datetime(2015, 3, 15, 23, 29, 13),
 datetime.datetime(2015, 3, 15, 23, 34, 28),
 datetime.datetime(2015, 3, 15, 23, 39, 43),
 datetime.datetime(2015, 3, 15, 23, 44, 58),
 datetime.datetime(2015, 3, 15, 23, 50, 13),
 datetime.datetime(2015, 3, 15, 23, 55, 28),
 datetime.datetime(2015, 3, 16, 0, 0, 43),
 datetime.datetime(2015, 3, 16, 0, 5, 59),
 datetime.datetime(2015, 3, 16, 0, 11, 14),
 datetime.datetime(2015, 3, 16, 0, 16, 29),
 datetime.datetime(2015, 3, 16, 0, 21, 44),
 datetime.datetime(2015, 3, 16, 0, 26, 59),
 datetime.datetime(2015, 3, 16, 0, 32, 14),
 datetime.datetime(2015, 3, 16, 0, 37, 29),
 datetime.datetime(2015, 3, 16, 0, 42, 44),
 datetime.datetime(2015, 3, 16, 0, 47, 59),
 datetime.datetime(2015, 3, 16, 0, 53, 14),
 datetime.datetime(2015, 3, 16, 0, 58, 30),
 datetime.datetime(2015, 3, 16, 1, 3, 45),
 datetime.datetime(2015, 3, 16, 1, 9),
 datetime.datetime(2015, 3, 16, 1, 14, 15),
 datetime.datetime(2015, 3, 16, 1, 19, 30),
 datetime.datetime(2015, 3, 16, 1, 24, 45),
 datetime.datetime(2015, 3, 16, 1, 30),
 datetime.datetime(2015, 3, 16, 1, 35, 15),
 datetime.datetime(2015, 3, 16, 1, 40, 30),
 datetime.datetime(2015, 3, 16, 1, 45, 45),
 datetime.datetime(2015, 3, 16, 1, 51, 1),
 datetime.datetime(2015, 3, 16, 1, 56, 16),
 datetime.datetime(2015, 3, 16, 2, 1, 31),
 datetime.datetime(2015, 3, 16, 2, 6, 46),
 datetime.datetime(2015, 3, 16, 2, 12, 1),
 datetime.datetime(2015, 3, 16, 2, 17, 16),
 datetime.datetime(2015, 3, 16, 2, 22, 31),
 datetime.datetime(2015, 3, 16, 2, 27, 46),
 datetime.datetime(2015, 3, 16, 2, 33, 1),
 datetime.datetime(2015, 3, 16, 2, 38, 16),
 datetime.datetime(2015, 3, 16, 2, 43, 32),
 datetime.datetime(2015, 3, 16, 2, 48, 47),
 datetime.datetime(2015, 3, 16, 2, 54, 2),
 datetime.datetime(2015, 3, 16, 2, 59, 17),
 datetime.datetime(2015, 3, 16, 3, 4, 32),
 datetime.datetime(2015, 3, 16, 3, 9, 47),
 datetime.datetime(2015, 3, 16, 3, 15, 2),
 datetime.datetime(2015, 3, 16, 3, 20, 17),
 datetime.datetime(2015, 3, 16, 3, 25, 32),
 datetime.datetime(2015, 3, 16, 3, 30, 47),
 datetime.datetime(2015, 3, 16, 3, 36, 3),
 datetime.datetime(2015, 3, 16, 3, 41, 18),
 datetime.datetime(2015, 3, 16, 3, 46, 33),
 datetime.datetime(2015, 3, 16, 3, 51, 48),
 datetime.datetime(2015, 3, 16, 3, 57, 3),
 datetime.datetime(2015, 3, 16, 4, 2, 18),
 datetime.datetime(2015, 3, 16, 4, 7, 33),
 datetime.datetime(2015, 3, 16, 4, 12, 48),
 datetime.datetime(2015, 3, 16, 4, 18, 3),
 datetime.datetime(2015, 3, 16, 4, 23, 18),
 datetime.datetime(2015, 3, 16, 4, 28, 34),
 datetime.datetime(2015, 3, 16, 4, 33, 49),
 datetime.datetime(2015, 3, 16, 4, 39, 4),
 datetime.datetime(2015, 3, 16, 4, 44, 19),
 datetime.datetime(2015, 3, 16, 4, 49, 34),
 datetime.datetime(2015, 3, 16, 4, 54, 49),
 datetime.datetime(2015, 3, 16, 5, 0, 4),
 datetime.datetime(2015, 3, 16, 5, 5, 19),
 datetime.datetime(2015, 3, 16, 5, 10, 34),
 datetime.datetime(2015, 3, 16, 5, 15, 49),
 datetime.datetime(2015, 3, 16, 5, 21, 5),
 datetime.datetime(2015, 3, 16, 5, 26, 20),
 datetime.datetime(2015, 3, 16, 5, 31, 35),
 datetime.datetime(2015, 3, 16, 5, 36, 50),
 datetime.datetime(2015, 3, 16, 5, 42, 5),
 datetime.datetime(2015, 3, 16, 5, 47, 20),
 datetime.datetime(2015, 3, 16, 5, 52, 35),
 datetime.datetime(2015, 3, 16, 5, 57, 50),
 datetime.datetime(2015, 3, 16, 6, 3, 5),
 datetime.datetime(2015, 3, 16, 6, 8, 20),
 datetime.datetime(2015, 3, 16, 6, 13, 36),
 datetime.datetime(2015, 3, 16, 6, 18, 51),
 datetime.datetime(2015, 3, 16, 6, 24, 6),
 datetime.datetime(2015, 3, 16, 6, 29, 21),
 datetime.datetime(2015, 3, 16, 6, 34, 36),
 datetime.datetime(2015, 3, 16, 6, 39, 51),
 datetime.datetime(2015, 3, 16, 6, 45, 6),
 datetime.datetime(2015, 3, 16, 6, 50, 21),
 datetime.datetime(2015, 3, 16, 6, 55, 36),
 datetime.datetime(2015, 3, 16, 7, 0, 51),
 datetime.datetime(2015, 3, 16, 7, 6, 7),
 datetime.datetime(2015, 3, 16, 7, 11, 22),
 datetime.datetime(2015, 3, 16, 7, 16, 37),
 datetime.datetime(2015, 3, 16, 7, 21, 52),
 datetime.datetime(2015, 3, 16, 7, 27, 7),
 datetime.datetime(2015, 3, 16, 7, 32, 22),
 datetime.datetime(2015, 3, 16, 7, 37, 37),
 datetime.datetime(2015, 3, 16, 7, 42, 52),
 datetime.datetime(2015, 3, 16, 7, 48, 7),
 datetime.datetime(2015, 3, 16, 7, 53, 22),
 datetime.datetime(2015, 3, 16, 7, 58, 38),
 datetime.datetime(2015, 3, 16, 8, 3, 53),
 datetime.datetime(2015, 3, 16, 8, 9, 8),
 datetime.datetime(2015, 3, 16, 8, 14, 23),
 datetime.datetime(2015, 3, 16, 8, 19, 38),
 datetime.datetime(2015, 3, 16, 8, 24, 53),
 datetime.datetime(2015, 3, 16, 8, 30, 8),
 datetime.datetime(2015, 3, 16, 8, 35, 23),
 datetime.datetime(2015, 3, 16, 8, 40, 38),
 datetime.datetime(2015, 3, 16, 8, 45, 53),
 datetime.datetime(2015, 3, 16, 8, 51, 9),
 datetime.datetime(2015, 3, 16, 8, 56, 24),
 datetime.datetime(2015, 3, 16, 9, 1, 39),
 datetime.datetime(2015, 3, 16, 9, 6, 54),
 datetime.datetime(2015, 3, 16, 9, 12, 9),
 datetime.datetime(2015, 3, 16, 9, 17, 24),
 datetime.datetime(2015, 3, 16, 9, 22, 39),
 datetime.datetime(2015, 3, 16, 9, 27, 54),
 datetime.datetime(2015, 3, 16, 9, 33, 9),
 datetime.datetime(2015, 3, 16, 9, 38, 24),
 datetime.datetime(2015, 3, 16, 9, 43, 40),
 datetime.datetime(2015, 3, 16, 9, 48, 55),
 datetime.datetime(2015, 3, 16, 9, 54, 10),
 datetime.datetime(2015, 3, 16, 9, 59, 25),
 datetime.datetime(2015, 3, 16, 10, 4, 40),
 datetime.datetime(2015, 3, 16, 10, 9, 55),
 datetime.datetime(2015, 3, 16, 10, 15, 10),
 datetime.datetime(2015, 3, 16, 10, 20, 25),
 datetime.datetime(2015, 3, 16, 10, 25, 40),
 datetime.datetime(2015, 3, 16, 10, 30, 55),
 datetime.datetime(2015, 3, 16, 10, 36, 11),
 datetime.datetime(2015, 3, 16, 10, 41, 26),
 datetime.datetime(2015, 3, 16, 10, 42, 24),
 datetime.datetime(2015, 3, 16, 10, 44, 34),
 datetime.datetime(2015, 3, 16, 10, 46, 44),
 datetime.datetime(2015, 3, 16, 10, 48, 54),
 datetime.datetime(2015, 3, 16, 10, 51, 4),
 datetime.datetime(2015, 3, 16, 10, 53, 14),
 datetime.datetime(2015, 3, 16, 10, 55, 24),
 datetime.datetime(2015, 3, 16, 10, 57, 34),
 datetime.datetime(2015, 3, 16, 10, 59, 44),
 datetime.datetime(2015, 3, 16, 11, 1, 54),
 datetime.datetime(2015, 3, 16, 11, 4, 4),
 datetime.datetime(2015, 3, 16, 11, 6, 14),
 datetime.datetime(2015, 3, 16, 11, 8, 25),
 datetime.datetime(2015, 3, 16, 11, 10, 35),
 datetime.datetime(2015, 3, 16, 11, 12, 45),
 datetime.datetime(2015, 3, 16, 11, 14, 55),
 datetime.datetime(2015, 3, 16, 11, 17, 5),
 datetime.datetime(2015, 3, 16, 11, 19, 15),
 datetime.datetime(2015, 3, 16, 11, 21, 25),
 datetime.datetime(2015, 3, 16, 11, 23, 35),
 datetime.datetime(2015, 3, 16, 11, 25, 45),
 datetime.datetime(2015, 3, 16, 11, 27, 55),
 datetime.datetime(2015, 3, 16, 11, 30, 6),
 datetime.datetime(2015, 3, 16, 11, 32, 16),
 datetime.datetime(2015, 3, 16, 11, 34, 26),
 datetime.datetime(2015, 3, 16, 11, 36, 36),
 datetime.datetime(2015, 3, 16, 11, 38, 46),
 datetime.datetime(2015, 3, 16, 11, 40, 56),
 datetime.datetime(2015, 3, 16, 11, 43, 6),
 datetime.datetime(2015, 3, 16, 11, 45, 16),
 datetime.datetime(2015, 3, 16, 11, 47, 26),
 datetime.datetime(2015, 3, 16, 11, 49, 36),
 datetime.datetime(2015, 3, 16, 11, 51, 47),
 datetime.datetime(2015, 3, 16, 11, 53, 57),
 datetime.datetime(2015, 3, 16, 11, 56, 7),
 datetime.datetime(2015, 3, 16, 11, 58, 17),
 datetime.datetime(2015, 3, 16, 12, 0, 27),
 datetime.datetime(2015, 3, 16, 12, 2, 37),
 datetime.datetime(2015, 3, 16, 12, 4, 47),
 datetime.datetime(2015, 3, 16, 12, 6, 57),
 datetime.datetime(2015, 3, 16, 12, 9, 7),
 datetime.datetime(2015, 3, 16, 12, 11, 17),
 datetime.datetime(2015, 3, 16, 12, 13, 28),
 datetime.datetime(2015, 3, 16, 12, 15, 38),
 datetime.datetime(2015, 3, 16, 12, 17, 48),
 datetime.datetime(2015, 3, 16, 12, 19, 58),
 datetime.datetime(2015, 3, 16, 12, 22, 8),
 datetime.datetime(2015, 3, 16, 12, 24, 18),
 datetime.datetime(2015, 3, 16, 12, 26, 28),
 datetime.datetime(2015, 3, 16, 12, 28, 38),
 datetime.datetime(2015, 3, 16, 12, 30, 48),
 datetime.datetime(2015, 3, 16, 12, 32, 58),
 datetime.datetime(2015, 3, 16, 12, 35, 9),
 datetime.datetime(2015, 3, 16, 12, 37, 19),
 datetime.datetime(2015, 3, 16, 12, 39, 29),
 datetime.datetime(2015, 3, 16, 12, 41, 39),
 datetime.datetime(2015, 3, 16, 12, 43, 49),
 datetime.datetime(2015, 3, 16, 12, 45, 59),
 datetime.datetime(2015, 3, 16, 12, 48, 9),
 datetime.datetime(2015, 3, 16, 12, 50, 19),
 datetime.datetime(2015, 3, 16, 12, 52, 29),
 datetime.datetime(2015, 3, 16, 12, 54, 39),
 datetime.datetime(2015, 3, 16, 12, 56, 50),
 datetime.datetime(2015, 3, 16, 12, 59),
 datetime.datetime(2015, 3, 16, 13, 1, 10),
 datetime.datetime(2015, 3, 16, 13, 3, 20),
 datetime.datetime(2015, 3, 16, 13, 5, 30),
 datetime.datetime(2015, 3, 16, 13, 7, 40),
 datetime.datetime(2015, 3, 16, 13, 9, 50),
 datetime.datetime(2015, 3, 16, 13, 12),
 datetime.datetime(2015, 3, 16, 13, 14, 10),
 datetime.datetime(2015, 3, 16, 13, 16, 20),
 datetime.datetime(2015, 3, 16, 13, 18, 31),
 datetime.datetime(2015, 3, 16, 13, 20, 41),
 datetime.datetime(2015, 3, 16, 13, 22, 51),
 datetime.datetime(2015, 3, 16, 13, 25, 1),
 datetime.datetime(2015, 3, 16, 13, 27, 11),
 datetime.datetime(2015, 3, 16, 13, 29, 21),
 datetime.datetime(2015, 3, 16, 13, 31, 31),
 datetime.datetime(2015, 3, 16, 13, 33, 41),
 datetime.datetime(2015, 3, 16, 13, 35, 51),
 datetime.datetime(2015, 3, 16, 13, 38, 1),
 datetime.datetime(2015, 3, 16, 13, 40, 12),
 datetime.datetime(2015, 3, 16, 13, 42, 22),
 datetime.datetime(2015, 3, 16, 13, 44, 32),
 datetime.datetime(2015, 3, 16, 13, 46, 42),
 datetime.datetime(2015, 3, 16, 13, 48, 52),
 datetime.datetime(2015, 3, 16, 13, 51, 2),
 datetime.datetime(2015, 3, 16, 13, 53, 12),
 datetime.datetime(2015, 3, 16, 13, 55, 22),
 datetime.datetime(2015, 3, 16, 13, 57, 32),
 datetime.datetime(2015, 3, 16, 13, 59, 42),
 datetime.datetime(2015, 3, 16, 14, 1, 53),
 datetime.datetime(2015, 3, 16, 14, 4, 3),
 datetime.datetime(2015, 3, 16, 14, 6, 13),
 datetime.datetime(2015, 3, 16, 14, 8, 23),
 datetime.datetime(2015, 3, 16, 14, 10, 33),
 datetime.datetime(2015, 3, 16, 14, 12, 43),
 datetime.datetime(2015, 3, 16, 14, 14, 53),
 datetime.datetime(2015, 3, 16, 14, 17, 3),
 datetime.datetime(2015, 3, 16, 14, 19, 13),
 datetime.datetime(2015, 3, 16, 14, 21, 23),
 datetime.datetime(2015, 3, 16, 14, 23, 34),
 datetime.datetime(2015, 3, 16, 14, 25, 44),
 datetime.datetime(2015, 3, 16, 14, 27, 54),
 datetime.datetime(2015, 3, 16, 14, 30, 4),
 datetime.datetime(2015, 3, 16, 14, 32, 14),
 datetime.datetime(2015, 3, 16, 14, 34, 24),
 datetime.datetime(2015, 3, 16, 14, 36, 34),
 datetime.datetime(2015, 3, 16, 14, 38, 44),
 datetime.datetime(2015, 3, 16, 14, 40, 54),
 datetime.datetime(2015, 3, 16, 14, 43, 4),
 datetime.datetime(2015, 3, 16, 14, 45, 15),
 datetime.datetime(2015, 3, 16, 14, 47, 25),
 datetime.datetime(2015, 3, 16, 14, 49, 35),
 datetime.datetime(2015, 3, 16, 14, 51, 45),
 datetime.datetime(2015, 3, 16, 14, 53, 55),
 datetime.datetime(2015, 3, 16, 14, 56, 5),
 datetime.datetime(2015, 3, 16, 14, 58, 15),
 datetime.datetime(2015, 3, 16, 15, 0, 25),
 datetime.datetime(2015, 3, 16, 15, 2, 35),
 datetime.datetime(2015, 3, 16, 15, 4, 45),
 datetime.datetime(2015, 3, 16, 15, 6, 56),
 datetime.datetime(2015, 3, 16, 15, 9, 6),
 datetime.datetime(2015, 3, 16, 15, 11, 16),
 datetime.datetime(2015, 3, 16, 15, 13, 26),
 datetime.datetime(2015, 3, 16, 15, 15, 36),
 datetime.datetime(2015, 3, 16, 15, 17, 46),
 datetime.datetime(2015, 3, 16, 15, 19, 56),
 datetime.datetime(2015, 3, 16, 15, 22, 6),
 datetime.datetime(2015, 3, 16, 15, 24, 16),
 datetime.datetime(2015, 3, 16, 15, 26, 26),
 datetime.datetime(2015, 3, 16, 15, 28, 37),
 datetime.datetime(2015, 3, 16, 15, 30, 47),
 datetime.datetime(2015, 3, 16, 15, 32, 57),
 datetime.datetime(2015, 3, 16, 15, 35, 7),
 datetime.datetime(2015, 3, 16, 15, 37, 17),
 datetime.datetime(2015, 3, 16, 15, 39, 27),
 datetime.datetime(2015, 3, 16, 15, 41, 37),
 datetime.datetime(2015, 3, 16, 15, 43, 47),
 datetime.datetime(2015, 3, 16, 15, 45, 57),
 datetime.datetime(2015, 3, 16, 15, 48, 7),
 datetime.datetime(2015, 3, 16, 15, 50, 18),
 datetime.datetime(2015, 3, 16, 15, 52, 28),
 datetime.datetime(2015, 3, 16, 15, 54, 38),
 datetime.datetime(2015, 3, 16, 15, 56, 48),
 datetime.datetime(2015, 3, 16, 15, 58, 58),
 datetime.datetime(2015, 3, 16, 16, 1, 8),
 datetime.datetime(2015, 3, 16, 16, 3, 18),
 datetime.datetime(2015, 3, 16, 16, 5, 28),
 datetime.datetime(2015, 3, 16, 16, 7, 38),
 datetime.datetime(2015, 3, 16, 16, 9, 48),
 datetime.datetime(2015, 3, 16, 16, 11, 59),
 datetime.datetime(2015, 3, 16, 16, 14, 9),
 datetime.datetime(2015, 3, 16, 16, 16, 19),
 datetime.datetime(2015, 3, 16, 16, 18, 29),
 datetime.datetime(2015, 3, 16, 16, 20, 39),
 datetime.datetime(2015, 3, 16, 16, 22, 49),
 datetime.datetime(2015, 3, 16, 16, 24, 59),
 datetime.datetime(2015, 3, 16, 16, 27, 9),
 datetime.datetime(2015, 3, 16, 16, 29, 19),
 datetime.datetime(2015, 3, 16, 16, 31, 29),
 datetime.datetime(2015, 3, 16, 16, 33, 40),
 datetime.datetime(2015, 3, 16, 16, 35, 50),
 datetime.datetime(2015, 3, 16, 16, 38),
 datetime.datetime(2015, 3, 16, 16, 40, 10),
 datetime.datetime(2015, 3, 16, 16, 42, 20),
 datetime.datetime(2015, 3, 16, 16, 44, 30),
 datetime.datetime(2015, 3, 16, 16, 46, 40),
 datetime.datetime(2015, 3, 16, 16, 48, 50),
 datetime.datetime(2015, 3, 16, 16, 51),
 datetime.datetime(2015, 3, 16, 16, 53, 10),
 datetime.datetime(2015, 3, 16, 16, 55, 21),
 datetime.datetime(2015, 3, 16, 16, 57, 31),
 datetime.datetime(2015, 3, 16, 16, 59, 41),
 datetime.datetime(2015, 3, 16, 17, 1, 51),
 datetime.datetime(2015, 3, 16, 17, 4, 1),
 datetime.datetime(2015, 3, 16, 17, 6, 11),
 datetime.datetime(2015, 3, 16, 17, 8, 21),
 datetime.datetime(2015, 3, 16, 17, 10, 31),
 datetime.datetime(2015, 3, 16, 17, 12, 41),
 datetime.datetime(2015, 3, 16, 17, 14, 51),
 datetime.datetime(2015, 3, 16, 17, 17, 2),
 datetime.datetime(2015, 3, 16, 17, 19, 12),
 datetime.datetime(2015, 3, 16, 17, 21, 22),
 datetime.datetime(2015, 3, 16, 17, 23, 32),
 datetime.datetime(2015, 3, 16, 17, 25, 42),
 datetime.datetime(2015, 3, 16, 17, 27, 52),
 datetime.datetime(2015, 3, 16, 17, 30, 2),
 datetime.datetime(2015, 3, 16, 17, 32, 12),
 datetime.datetime(2015, 3, 16, 17, 34, 22),
 datetime.datetime(2015, 3, 16, 17, 36, 32),
 datetime.datetime(2015, 3, 16, 17, 38, 43),
 datetime.datetime(2015, 3, 16, 17, 40, 53)]

In [39]:
index = []
for i,e in enumerate(hagis.date):
    if e is None:
        index.append(i)
        
print(index)

if index:
    hagis.date = np.delete(hagis.date, index)
    hagis.dn_interp = np.delete(hagis.dn_interp,index, axis=0)


[]

In [40]:
xfmt = dates.DateFormatter('%m/%d %H:%M')
xi = date2num(hagis.date)
XI, YI = meshgrid(xi, hagis.diam_interp)
#XI = dates.datetime.datetime.fromtimestamp(XI)
Z = hagis.dn_interp.transpose()
Z[np.where(Z <= 0)] = np.nan

In [45]:
pmax = 1e6 # 10**np.ceil(np.log10(np.amax(Z[np.where(Z > 0)])))
pmin = 1 #10**np.floor(np.log10(np.amin(Z[np.where(Z > 0)])))
fig, ax = plt.subplots()
pc = ax.pcolor(XI, YI, Z, cmap=plt.cm.jet, norm=colors.LogNorm(pmin, pmax, clip=False), alpha=0.8)

plt.colorbar(pc)
plt.yscale('log')
plt.ylim(5, 1000)
ax.xaxis.set_major_formatter(xfmt)
fig.autofmt_xdate()
fig.tight_layout()


Use of the SizeDistr Object

The sizeditribution package contains some classes and routines for ready manipulation of the data. But first, we will need to convert the data of interest to a PANDAS data frame with the time as index.


In [46]:
dataframe = pd.DataFrame(hagis.dn_interp)
dataframe.index = hagis.date

In addition, we will need to convert the bin centers produced by the SMPS object to bin edges. To do this, we will make the simple assumption that the bin edges are just the halfway points between the centers. For the edge cases, we will simply take the difference between the smallest bin center and the halfway point between the first and second bin centers and subtract this value from the smallest diameter. Similarly, for the largest diameter, we will take the difference between the halfway point between the largest and second largest bin centers and the largest bin center and add it to the largest bin center.


In [47]:
binedges = (hagis.diam_interp[1:]+hagis.diam_interp[:-1])/2
first = hagis.diam_interp[0] -(binedges[0]-hagis.diam_interp[0])
last = hagis.diam_interp[-1]+ (hagis.diam_interp[-1]-binedges[-1])
binedges = np.append([first],binedges)
binedges=np.append(binedges,[last])
sizeDistr = sd.SizeDist_TS(dataframe,binedges, 'dNdlogDp')

In [48]:
f,a,b,c = sizeDistr.plot(vmax = pmax, vmin = pmin, norm='log', showMinorTickLabels=False, cmap=plt.cm.jet)
a.set_ylim((5,1000))


Out[48]:
(5, 1000)

Once we have the corresponding SizeDistr object, we can now change the current distribution which is in $dN/d\log D_p$ space and change this to a surface area distribution in log space. This will produce a new object that we will call sfSD.


In [49]:
sfSD = sizeDistr.convert2dSdlogDp()

In [50]:
from imp import reload
reload(sd)


Out[50]:
<module 'atmPy.sizedistribution' from 'C:\\Users\\mrichardson\\Documents\\PythonScripts\\atm_py\\atmPy\\sizedistribution.py'>

In [52]:
f,a,b,c = sfSD.plot(vmax = 1e10, vmin = 1e4, norm='log', showMinorTickLabels=False,removeTickLabels=['200','300','400',] ,cmap =plt.cm.jet)
a.set_ylim((5,1000))


Out[52]:
(5, 1000)

To get an overall view, we can further manipulate the data to produce average distributions from the entire time series.


In [53]:
avgAt = sizeDistr.average_overAllTime()


C:\Anaconda3\lib\site-packages\numpy\core\_methods.py:59: RuntimeWarning: Mean of empty slice.
  warnings.warn("Mean of empty slice.", RuntimeWarning)

In [54]:
f,a = avgAt.plot(norm='log')
# a.set_yscale('log')



In [55]:
avgAtS = sfSD.average_overAllTime()

In [56]:
f,a= avgAtS.plot(norm='log')
a.set_yscale('log')


In the previous analysis, it appears that we have a size distribution which centers around 60 nm in number and somewhere around 100 to 200 nm in surface.


In [ ]: